package com.prs.crm.domain.assets;

import java.sql.Date;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;

import com.prs.crm.domain.Attachment;
import com.prs.crm.domain.BaseEntity;
import com.prs.crm.domain.flow.WorkFlow;
import com.prs.crm.domain.hr.Person;
/**
 * @author liaopinghong
 * @version 2012-6-6 10:17:13 资产领用
 * 
 * */
@Entity
@Table(name="ass_lingyong")
public class AssetsLingYong extends BaseEntity{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private int id;
	/**申请名称*/               
	private String sname;
	/**申请状态*/               
	private String sstate;
	/**领用单号*/               
	private String number;
	/**领用人*/               
	private String luser;
	/**领用部门*/               
	private String ldep;               
	/**领用时间*/               
	private Date ldate;
	/**领用明细*/               
	@OneToMany(cascade={CascadeType.ALL})
	private Set<AssetsRegister> assetsRegisters; 
	/**备注*/               
	private String remark;
	/**领用说明*/
	private String shuoming;
	/**审批状态*/
	private Integer type;       //0未提交,1审批中2已通过
	/**审批人*/
	private String spren;
	/**审批步骤*/
	private String spbz;
	/**领用人*/
	@ManyToOne
	private Person person;
	@ManyToOne(fetch=FetchType.LAZY)
	@Cascade({org.hibernate.annotations.CascadeType.ALL,org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
	private Attachment attach; 
	@ManyToOne
	private WorkFlow workFlow;
	/**
	 * 设置是否显示
	 * 1：显示 
	 */
	private String showstate;
	private String personAppProcess;
	private Integer personAppState;
	public WorkFlow getWorkFlow() {
		return workFlow;
	}
	public void setWorkFlow(WorkFlow workFlow) {
		this.workFlow = workFlow;
	}
	public String getShowstate() {
		return showstate;
	}
	public void setShowstate(String showstate) {
		this.showstate = showstate;
	}
	public String getPersonAppProcess() {
		return personAppProcess;
	}
	public void setPersonAppProcess(String personAppProcess) {
		this.personAppProcess = personAppProcess;
	}
	public Integer getPersonAppState() {
		return personAppState;
	}
	public void setPersonAppState(Integer personAppState) {
		this.personAppState = personAppState;
	}
	public Attachment getAttach() {
		return attach;
	}
	public void setAttach(Attachment attach) {
		this.attach = attach;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getSname() {
		return sname;
	}
	public void setSname(String sname) {
		this.sname = sname;
	}
	public String getSstate() {
		return sstate;
	}
	public void setSstate(String sstate) {
		this.sstate = sstate;
	}
	public String getNumber() {
		return number;
	}
	public void setNumber(String number) {
		this.number = number;
	}
	public String getLuser() {
		return luser;
	}
	public void setLuser(String luser) {
		this.luser = luser;
	}
	public String getLdep() {
		return ldep;
	}
	public void setLdep(String ldep) {
		this.ldep = ldep;
	}
	public Date getLdate() {
		return ldate;
	}
	public void setLdate(Date ldate) {
		this.ldate = ldate;
	}
	public Set<AssetsRegister> getAssetsRegisters() {
		return assetsRegisters;
	}
	public void setAssetsRegisters(Set<AssetsRegister> assetsRegisters) {
		this.assetsRegisters = assetsRegisters;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public String getShuoming() {
		return shuoming;
	}
	public void setShuoming(String shuoming) {
		this.shuoming = shuoming;
	}
	public Integer getType() {
		return type;
	}
	public void setType(Integer type) {
		this.type = type;
	}
	public String getSpren() {
		return spren;
	}
	public void setSpren(String spren) {
		this.spren = spren;
	}
	public String getSpbz() {
		return spbz;
	}
	public void setSpbz(String spbz) {
		this.spbz = spbz;
	}
	public Person getPerson() {
		return person;
	}
	public void setPerson(Person person) {
		this.person = person;
	}
	

}
